import Vue from "vue";
import App from "./App.vue";
import router from "./router";

Vue.config.productionTip = false;
Vue.directive('has',{
  inserted(el,binding){
    console.log(el)
    let role = binding.arg//按钮需要的权限
    let userRole = binding.value//用户需要的权限
    let hasRole = userRole.includes(role)//判断用户有没有按钮权限
    if(!hasRole){
      // el.disabled = true//1.禁用
        el.parentNode.removeChild(el)//2.parentNode父节点  让父节点移除自己
    }
  }
})

new Vue({
  router,
  render: (h) => h(App),
}).$mount("#app");
